<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 17.8.15
 * Time: 17:21
 */


/**
 * @param $errors
 * @return int|string
 */
function formatErrors($errors)
{
    $i = 0;
    $str = [];
    $messages = $errors->getMessages();
    foreach ($messages as $key => $value) {
        $str[] = ($value[0]);
    }

    $str = implode($str, "<br>");

    return $str;

}